import 'package:mziot/app/data/circle_list_entity.dart';
import 'package:mziot/generated/json/base/json_convert_content.dart';

CircleListEntity $CircleListEntityFromJson(Map<String, dynamic> json) {
  final CircleListEntity circleListEntity = CircleListEntity();
  final List<String>? images = jsonConvert.convertListNotNull<String>(json['images']);
  if (images != null) {
    circleListEntity.images = images;
  }
  final CircleListVos? vos = jsonConvert.convert<CircleListVos>(json['vos']);
  if (vos != null) {
    circleListEntity.vos = vos;
  }
  return circleListEntity;
}

Map<String, dynamic> $CircleListEntityToJson(CircleListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['images'] = entity.images;
  data['vos'] = entity.vos?.toJson();
  return data;
}

CircleListVos $CircleListVosFromJson(Map<String, dynamic> json) {
  final CircleListVos circleListVos = CircleListVos();
  final List<CircleListVosList>? list =
      jsonConvert.convertListNotNull<CircleListVosList>(json['list']);
  if (list != null) {
    circleListVos.list = list;
  }
  final bool? hasNext = jsonConvert.convert<bool>(json['hasNext']);
  if (hasNext != null) {
    circleListVos.hasNext = hasNext;
  }
  return circleListVos;
}

Map<String, dynamic> $CircleListVosToJson(CircleListVos entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  data['hasNext'] = entity.hasNext;
  return data;
}

CircleListVosList $CircleListVosListFromJson(Map<String, dynamic> json) {
  final CircleListVosList circleListVosList = CircleListVosList();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    circleListVosList.id = id;
  }
  final String? mainTitle = jsonConvert.convert<String>(json['mainTitle']);
  if (mainTitle != null) {
    circleListVosList.mainTitle = mainTitle;
  }
  final String? shortContent = jsonConvert.convert<String>(json['shortContent']);
  if (shortContent != null) {
    circleListVosList.shortContent = shortContent;
  }
  final String? publicTime = jsonConvert.convert<String>(json['publicTime']);
  if (publicTime != null) {
    circleListVosList.publicTime = publicTime;
  }
  final int? commentNum = jsonConvert.convert<int>(json['commentNum']);
  if (commentNum != null) {
    circleListVosList.commentNum = commentNum;
  }
  final int? likedNum = jsonConvert.convert<int>(json['likedNum']);
  if (likedNum != null) {
    circleListVosList.likedNum = likedNum;
  }
  final String? mainImg = jsonConvert.convert<String>(json['mainImg']);
  if (mainImg != null) {
    circleListVosList.mainImg = mainImg;
  }
  return circleListVosList;
}

Map<String, dynamic> $CircleListVosListToJson(CircleListVosList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['mainTitle'] = entity.mainTitle;
  data['shortContent'] = entity.shortContent;
  data['publicTime'] = entity.publicTime;
  data['commentNum'] = entity.commentNum;
  data['likedNum'] = entity.likedNum;
  data['mainImg'] = entity.mainImg;
  return data;
}
